<template>
	<view>
		<Header title="班级" bgColor="#FFFFFF" :showBack="true"></Header>
		<view class="list">
			<view @click="toIndex(item.id,item.organizationName)" v-for="(item,index) in list" :key="index">
				<image src="../../static/class.png" mode=""></image>
				<view>{{item.organizationName}}</view>
				<image src="../../static/go.png" mode=""></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[]
			}
		},
		onLoad(e) {
				this.getClassList(e.id)
		},
		methods: {
			toIndex(id,name){
				uni.navigateTo({
					url:'/pages/student/student?id='+id+'&name='+name
				})
			},
			getClassList(parentId){
				// this.$http('/member/api/organization/getOwnerList',{ "condition":{"isOrganization":true}},res=>{
				// 	this.list = res.data.items
				// })
				
				this.$http('/member/api/organization/getOwnerList',{"condition":{"isOrganization":false,"parentId":parentId}},res=>{
					this.list = res.data.items
				})
				
				
				
			},
			
		}
	}
</script>

<style scoped lang="less">
	.list {
		width: 93%;
		margin: 20upx auto;
		background-color: #FFFFFF;
	
		>view {
			width: 100%;
			height: 150upx;
			border-bottom: 1upx solid #dddddd;
			background-color: #FFFFFF;
			display: flex;
			align-items: center;
			
			>image:first-child{
				width: 50upx;
				height: 50upx;
				margin-left: 40upx;
			}
			>view{
				width: 75%;
				box-sizing: border-box;
				padding-left: 40upx;
				height: 100%;
				line-height: 150upx;
			}
			>image:last-child{
				width: 30upx;
				height: 30upx;
			}
		}
		
	}
</style>
